package com.example.service.imple;

import com.example.dao.ClientsMapper;
import com.example.entity.Clients;
import com.example.service.ClientsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ClientsServiceImpl implements ClientsService {
    @Autowired
    private ClientsMapper clientsMapper;

    @Override
    public List<Clients> getAllClientss() {
        return clientsMapper.listClientss();
    }

    @Override
    public List<Clients> listClientssByParams(Map<String, Object> params) {
        return clientsMapper.listClientssByParams(params);
    }

    public Integer addClients(Clients Clients) {
        clientsMapper.insertClients(Clients);
        return Clients.getId();
    }

    public Integer updateClients(Clients Clients) {
        clientsMapper.updateClients(Clients);
        return Clients.getId();
    }

    public Integer deleteClients(int id) {
        clientsMapper.deleteClientsById(id);
        return id;
    }

    public void deleteClientss(List<String> ids) {
        clientsMapper.deleteClientss(ids);
        // return id;
    }

    public Clients getClientsById(int id) {
        return clientsMapper.getClientsById(id);
    }


}